package com.lc.pianostudent.activity;

import android.os.Bundle;
import android.util.Log;


import com.lc.pianostudent.BaseApplication;
import com.lc.pianostudent.R;
import com.zcx.helper.app.AppApplication;

/**
 * Created by Administrator on 2016/3/14.
 */
public class WelcomeActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentViewAsy(R.layout.activity_welcome);

    }

    @Override
    public void onAsyLayoutInit(Bundle savedInstanceState) {
        /**
         * 用于在欢迎页使用，主要用于当前应用动态申请SD卡读取权限创建跟框架有关的本地文件夹目录
         * 延时3秒，3秒后会弹起权限申请对话框，确认开启后onSuccess()会被回调。
         * 如果不开启权限会弹出退出应用对话框
         */
        BaseApplication.INSTANCE.initAppRoot(this, new AppApplication.OnAppRootCallBack() {

            @Override
            public void onSuccess() {

                //跳转页面
                startVerifyActivity(BaseApplication.BasePreferences.readIsGuide() ? NavigationActivity.class : GuideActivity.class);

                finish();
            }

        },3000);

    }
}
